package cn.cocho.android.mc.comp.toast;

import android.content.Context;
import android.graphics.Color;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;

public class McToast extends Toast{

	private Context context;
	public McToast(Context context) {
		super(context);
		init(context);
	}

	private void init(Context context){
		this.context=context;
	}
	
	public void setView(int layoutId,int msgViewId,String msg,int duration,int gravity){
		LayoutInflater inflater = LayoutInflater.from(context);
		View layout = inflater.inflate(layoutId, null);
		TextView text = (TextView) layout.findViewById(msgViewId);
		text.setText(msg);
		text.setTextColor(Color.GRAY);
		this.setView(layout);
		this.setGravity(gravity, 0, 100);
		this.show();
	}
	
}
